Add name filter to metrics - #23719
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23719 +/- ##
==========================================
+ Coverage 80.66% 80.88% +0.21%
==========================================
Files 1095 1095
Lines 372294 375556 +3262
Branches 372294 375556 +3262
==========================================
+ Hits 300324 303771 +3447
+ Misses 54055 53978 -77
+ Partials 17915 17807 -108 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gabotechs
force-pushed
the
gabotechs/filter-metrics-by-name
branch
from
July 27, 2026 09:41
f743c5a to
bd0852b
Compare
gabotechs
marked this pull request as ready for review
July 27, 2026 09:42
Contributor
Author
|
I'm opening this one for review, I think it's worth having it regardless of the other PR I'm mentioning in the description. cc @2010YOUY01 |
kosiew
approved these changes
Jul 28, 2026
Contributor
There was a problem hiding this comment.
@gabotechs
Looks good overall. I only have one small suggestion that could make the API contract a bit clearer for callers.
gabotechs
force-pushed
the
gabotechs/filter-metrics-by-name
branch
from
July 28, 2026 08:21
2c01ff8 to
403c4d3
Compare
Contributor
Author
|
Thanks @kosiew for the review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Precedes #23720.
While displaying a plan with metrics, allow filtering them by name, not just by category or type.
This is very useful when writing snapshot tests where only a specific metrics needs to be asserted, without other unrelated metrics polluting the snapshot assertion.
Regardless of what happens with #23720, I think this PR is still worth it, as it allows creating some really nice
instatests asserting runtime properties reliably by just cherry picking the runtime metrics relevant for that specific test. This is relevant not only within DataFusion codebase, but also for other people's codebases using DataFusion and relying oninstafor snapshot testing, See an example of this here: https://github.com/apache/datafusion/pull/23720/changes#diff-8281405e117428077c19c07afbbe59fed303a3460096e958f761d34f0899b618What changes are included in this PR?
While displaying metrics, allows filtering them by name
Are these changes tested?
Yes, by a new small test.
Are there any user-facing changes?
People using the metrics display API will be able to filter metrics by name.